<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PM用户登录</title>
<link rel="stylesheet" href="${basepath}/css/pm.css" type="text/css">
</head>
<body>
	<div id="showmsg_div">
		<span style="color:#FF0000;">${SHOW_MESSAGESS!""}</span>
	</div>
	<div id="userlogin_div">
		<form id="userlogin_form" name="userlogin_form" action="${basepath}/login.htm" method="post" target="_top">
			<fieldset>
				<legend>用户登录</legend>
				<ul>
					<li>
						<label><span>登录帐号:</span><label>
						<input type="text" name="loginname" id="loginname"/>
						<div></div>
					</li>
					<li>
						<label><span>登录密码:</span><label>
						<input type="password" name="passwd" id="passwd"/>
						<div></div>
					</li>
					<li>
						<label><span></span></label>
						<img src="${basepath}/Kaptcha.jpg" width="200" id="kaptchaImage" /><br/>
						<small>Can't read the image? Click it to get a new one.</small>
					</li>
					<li>
						<label><span>验证码:</span></label>
						<input type="text" name="REQUEST_KAPTCHA_KEY" />
						<div></div>
					</li>
					<li>
						<input id="login_btn" type="submit" value="登  录" />
						<input id="reset_btn" type="reset" value="清除登录信息" />
						<input type="checkbox" id="chk_tempsavecookie" /><label for="chk_tempsavecookie">保存登录信息</label>
					</li>
				</ul>
			</fieldset>			
		</form>
	</div>
</body>
<script type="text/javascript" src="${basepath}/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="${basepath}/js/jqaop-0.1.js"></script>
<script type="text/javascript" src="${basepath}/js/pm_jstool.js"></script>

<script type="text/javascript">
var cookiename_username = "cookiename_username";
$(function(){
    $('#kaptchaImage').click(function () { 
        $(this).attr('src', '${basepath}/Kaptcha.jpg?' + Math.floor(Math.random()*9999) ); 
    });
   
    <#--清空登录信息-->
    $("#reset_btn").click(function(){
		pm_removecookie(cookiename_username);
		$("#chk_tempsavecookie").prop("checked", false);
		$("#passwd").attr("value", "");
		$("#loginname").attr("value", "").focus();
    });
    
    $("#passwd").attr("value", "");
    var temp_username = pm_getcookie(cookiename_username);
	$("#loginname").attr("value", temp_username);
	
	$("#chk_tempsavecookie").prop("checked", !(temp_username==null||$.trim(temp_username)===""));
    
});

//jQuery的AOP
$("#userlogin_form").jqsetaop("submit", function(jthis){
	if($("#chk_tempsavecookie").prop("checked")){
		pm_savecookie(cookiename_username, $("#loginname").attr("value"));
	}
	return jthis.exeprocess();
}); 
  
</script>
</html>